<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="cn.edu.pku.ssm.dao.UserDAO" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  	<head></head>
	<body style="font-size:30pt;">
	<% 
	String name = request.getParameter("name"); 
	if (name == null) { 
%> 
	<form method="get" action="getAge.jsp"> 
		<font size="+2">What's your name?</font><br/> 
		<input type="text" name="name" /><br/> 
		<input type="submit" /> 
	</form> 
<% 
	} else { 
	    int age = UserDAO.getAge(name);
		out.println("<h2>Your age is " + age + "!</h2>"); 
	} 
%> 
	</body>
</html>
